#pragma once

#include <linux/build_bug.h>
#include <linux/stddef.h>

#define container_of(ptr, type, member)              \
    ({                                               \
        void *__mptr = (void *)(ptr);                \
        ((type *)(__mptr - offsetof(type, member))); \
    })
